// 1ts和js的区别
// ts是js超集 ts是js的加强版 ts是强类型 js是弱类型 
// ts 在开发阶段就提示错误。代码更严谨
import { createRouter, createWebHistory } from 'vue-router'
// RouteRecordRaw 路由配置项ts类型
import type { RouteRecordRaw } from "vue-router";
// 2路由配置
let routes: RouteRecordRaw[] = [
  {
    path: "/home",
    name: "home",
    component: () => import("../views/home/index.vue")
  },
  {
    path: "/cart",
    name: "cart",
    component: () => import("../views/cart/index.vue"),
    meta: {
      keepAlive: true
    }
  },
  {
    path: "/play",
    name: "play",
    component: () => import("../views/play/index.vue")
  },
  {
    path: "/mine",
    name: "mine",
    component: () => import("../views/mine/index.vue")
  },
  {
    path: "/cate",
    name: "cate",
    component: () => import("../views/cate/index.vue")
  }
]
let router = createRouter({
  history: createWebHistory(),
  routes
})
export default router